home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / C64 / T-TPUG Old Monthly Disks / (c)t8.d64 / etch a sketch.c (.txt) < prev    next >
Commodore BASIC  |  2007-02-04  |  1KB  |  42 lines

  1. 2 PRINT"[147]":FORS=1TO5:PRINT:NEXT:PRINTTAB(10)"ETCH-A-SKETCH":PRINTTAB(10)"-------------":PRINT:PRINT:PRINT
  2. 4 PRINT"YOU START AT THE UPPER LEFT CORNER.":PRINT"THE COMMANDS ARE:":PRINT
  3. 6 PRINT"E [206][205]","R [208]":PRINT:PRINT"D >","C [186]":PRINT:PRINT"X [205][206]","Z [204]":PRINT:PRINT"S _","W [207]":PRINT:PRINT"* CLR SCREEN"
  4. 8 PRINT: INPUT"PRESS RETURN";S$
  5. 10 BASE=2*4096:POKE53272,PEEK(53272)OR8:POKE53265,PEEK(53265)OR32
  6. 20 FORI=BASETOBASE+7999:POKEI,0:NEXT:FORI=1024TO2023:POKEI,3:NEXT:X=0:BIT=7:UP=7
  7. 30 IFPEEK(203)=14THENX=X-1:GOTO 100
  8. 35 IFPEEK(203)=17THENX=X-1:BIT=BIT-1:GOTO 110
  9. 40 IFPEEK(203)=18THENBIT=BIT-1:GOTO 120
  10. 45 IFPEEK(203)=20THENX=X+1:BIT=BIT-1:GOTO 130
  11. 50 IFPEEK(203)=23THENX=X+1:GOTO 140
  12. 55 IFPEEK(203)=12THENX=X+1:BIT=BIT+1:GOTO 150
  13. 60 IFPEEK(203)=13THENBIT=BIT+1:GOTO160
  14. 65 IFPEEK(203)=9THENX=X-1:BIT=BIT+1:GOTO 170
  15. 67 IFPEEK(203)=49THENGOTO10
  16. 70 GOTO30
  17. 80 A=PEEK(BASE+X)+(2^BIT)
  18. 81 IFPEEK(X+BASE)=255THENA=255
  19. 82 IFA>255THENA=128
  20. 83 POKEX+BASE,A
  21. 85 GOTO30
  22. 100 UP=UP+1:IFUP>7THENX=X-312:UP=0:GOTO80
  23. 105 GOTO80
  24. 110 UP=UP+1:IFUP>7THENX=X-312:UP=0
  25. 115 IFBIT<0 THENX=X+8:BIT=7:GOTO80
  26. 117 GOTO80
  27. 120 IFBIT<0 THENX=X+8:BIT=7:GOTO80
  28. 125 GOTO80
  29. 130 UP=UP-1:IFUP<0 THENX=X+312:UP=7
  30. 135 IFBIT<0 THENX=X+8:BIT=7:GOTO80
  31. 137 GOTO80
  32. 140 UP=UP-1:IFUP<0THENX=X+312:UP=7
  33. 143 GOTO80
  34. 150 UP=UP-1:IFUP<0THENX=X+312:UP=7
  35. 155 IFBIT>7THENX=X-8:BIT=0
  36. 157 GOTO80
  37. 160 IFBIT>7THENX=X-8:BIT=0
  38. 165 GOTO80
  39. 170 UP=UP+1:IFUP>7THENX=X-312:UP=0
  40. 175 IFBIT>7THENX=X-8:BIT=0
  41. 177 GOTO80
  42.